// 解析JSON并转换为MyModel
import 'package:learning/bean/category_entity.dart';

class JsonModel {
  static T decodeJsonItem<T>(dynamic item) {
    if (T == CategoryEntity) {
      print(item);
      print(item.runtimeType);
      return CategoryEntity.fromJson(item) as T;
    }

    throw ArgumentError('Unsupported type $T');
  }
}
